home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FGL304E.ZIP;1 / EXPAS.ARJ / FGDOC / EXAMPLES / PASCAL / 12-05.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-01-24  |  1.3 KB  |  63 lines

  1. {$M 16384,0,0}
  2.  
  3. program main;
  4. uses fgmain, fgmisc;
  5.  
  6. const
  7.   VISUAL = 0;
  8.   HIDDEN = 1;
  9.  
  10. var
  11.   status   : integer;
  12.   new_mode : integer;
  13.   old_mode : integer;
  14.   frame, offset, i : integer;
  15.  
  16. begin
  17.  
  18.   { initialize the video environment }
  19.  
  20.   new_mode := fg_bestmode(320,200,2);
  21.   if (new_mode < 0) or (new_mode = 12) then
  22.   begin
  23.     write('This program requires a 320 ');
  24.     writeln('x 200 color graphics mode.');
  25.     exit;
  26.   end;
  27.   old_mode := fg_getmode;
  28.   fg_setmode(new_mode);
  29.   status := fg_allocate(HIDDEN);
  30.  
  31.   { draw the background in the upper left corner }
  32.  
  33.   fg_setpage(HIDDEN);
  34.   fg_setcolor(1);
  35.   fg_rect(0,95,0,49);
  36.   fg_setcolor(15);
  37.   fg_move(48,25);
  38.   fg_ellipse(20,20);
  39.  
  40.   { copy it to the center of the visual page }
  41.  
  42.   fg_transfer(0,95,0,49,112,124,HIDDEN,VISUAL);
  43.  
  44.   { slide the object across the background three times }
  45.  
  46.   fg_setcolor(10);
  47.   for i := 0 to 35 do
  48.   begin
  49.     frame  := i mod 12;
  50.     offset := 10 * frame - 10;
  51.     fg_transfer(0,95,20,29,112,105,HIDDEN,HIDDEN);
  52.     fg_rect(112+offset,131+offset,96,105);
  53.     fg_transfer(112,207,96,105,112,105,HIDDEN,VISUAL);
  54.     fg_waitfor(2);
  55.   end;
  56.  
  57.   { restore the original video mode and return to DOS }
  58.  
  59.   status := fg_freepage(HIDDEN);
  60.   fg_setmode(old_mode);
  61.   fg_reset;
  62. end.
  63.